package tools;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

public class Physics {
    public static boolean checkBlockCollision(Rect q1, Rect q2)
    {
        if(q1.x >= q2.x + q2.w)
        {
            return false;
        }
        if(q1.y >= q2.y + q2.h)
        {
            return false;
        }
        if(q1.x + q1.w <= q2.x)
        {
            return false;
        }
        if(q1.y + q1.h <= q2.y)
        {
            return false;
        }
        
        return true;
    }
    
    public static double getDistance(double x1, double y1, double x2, double y2)
    {
    	return Math.sqrt(((x1-x2)*(x1-x2))+((y1-y2)*(y1-y2)));
    }
}
